Add centralized exception handling and new exception types#193
Add centralized exception handling and new exception types#193mpartipilo merged 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Secrets | View in Orca |
3a4fc92 to
1bd235a
Compare
64f3126 to
920e40f
Compare
dirkkul
left a comment
There was a problem hiding this comment.
Could you add a test? :) You have an RBAC cluster, so you could try to connect there with:
- wrong api key
- not enough permissions for an operation (example: create collection with admin-key and then try to insert+insert_many (http+rest) with a viewer key
Certainly! |
| } | ||
|
|
||
| // Re-throw the original exception if we can't map it | ||
| throw innerException; |
There was a problem hiding this comment.
Should we wrap unmapped exceptions in a generic WeaviateServerException instead of re-throwing the original exception? This would ensure that callers can always catch a WeaviateServerException, which simplifies error handling logic
There was a problem hiding this comment.
The original innerException should always be a WeaviateServerException, but more specific ones can be made out of it by mapping using status code and if needed by parsing the error message too.
45280ba to
08d2360
Compare
…authentication and authorization
- Added WeaviateTimeoutException to represent timeout errors with detailed messages. - Enhanced ExceptionHelper to map HTTP and gRPC exceptions to WeaviateTimeoutException when timeouts occur. - Introduced TimeoutHelper to manage timeout contexts using AsyncLocal for distinguishing between timeout and user cancellations. - Updated RetryHandler to throw WeaviateTimeoutException on timeout after retries. - Created comprehensive unit tests for timeout handling, including edge cases and context isolation. - Ensured that timeout contexts are preserved across asynchronous boundaries and cleared appropriately.
…tion exception handling
…per and add corresponding unit tests
f5fda99 to
ceefe27
Compare
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
4e2fc9d to
87a2f88
Compare
Summary - Weaviate C# Client Coverage
Risk Hotspots
Coverage
|
Introduce centralized exception handling for gRPC and HTTP requests, improving error management across the application. Additionally, implement new exception types for authentication and authorization failures to enhance clarity in error reporting. Fix the path for uploading testing artifacts to ensure correct file handling.